<template>
    <h2>详情物资采购</h2>
    <!--border="1px solid #ccc" cellspacing="0" cellpadding="0"-->
    <table>
        <thead></thead>
        <tbody v-for="ine in tableData">
            <tr>
                <td>货物名称：{{ ine.sPCargoName }}</td>
            </tr>
            <tr>
                <td>类型：{{ ine.typeName }}</td>
            </tr>
            <tr>
                <td>材质：{{ ine.materiaLqualityName }}</td>
            </tr>
            <tr>
                <td>规格：{{ ine.sPGaugeLattice }}</td>
            </tr>
            <tr>
                <td>数量：{{ ine.sPQuantity }}</td>
            </tr>
            <tr>
                <td>用途描述：{{ ine.sPPurposeDescription.substring(0, 10) }}</td>
            </tr>
            <tr>
                <td>申请人：{{ ine.createName }}</td>
            </tr>
            <tr>
                <td>期望交付日期：{{ ine.sPExpectedDeliveryDate.substring(0, 10) }}</td>
            </tr>
            <tr>
                <td>备注：{{ ine.sPReserveNote }}</td>
            </tr>
            <tr>
                <td>创建日期：{{ ine.createDate }}</td>
            </tr>
            <tr>
                <td>审批状态：
                    <span v-if="ine.sPApprovalStatus == 1">待提交</span>
                    <span v-if="ine.sPApprovalStatus == 10">待审批</span>
                    <span v-if="ine.sPApprovalStatus == 20">已通过</span>
                    <span v-if="ine.sPApprovalStatus == 30">已拒绝</span>
                    &nbsp; &nbsp; &nbsp;
                    申请人：
                    <span v-if="ine.sPApprover == 'string' || ine.sPApprover == null">-</span>
                    <span v-else>{{ ine.sPApprover }}</span>
                </td>
            </tr>
        </tbody>
    </table>
</template>

<script setup lang='ts'>
import { reactive, ref, onMounted, watch } from 'vue'
import axios from 'axios';
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
//生命函数钩
onMounted(() => {
    //物资采购详情
    SuppliesPurchasingList();
})
//显示列表
const tableData = ref([])
//物资采购显示
const SuppliesPurchasingList = () => {
    axios.get("MaterialRead/api/SuppliesPurchasing/XQSuppliesPurchasing?sPCargoID=" + route.query.id).then(res => {
        tableData.value = res.data.data;
    }).catch(err => {
        console.log(err)
    })
}

</script>

<style></style>